Type effect callback payloads - #48
Conversation
Publish shared callback and error contracts, and check the SQL and Cloudflare envelope construction before JSON serialization. Preserve existing payload fields, retry decisions, and normalization behavior. Closes #47
|
@greptileai please review the current head for issue #47, including shared payload construction, compatibility, and type-test coverage. |
Greptile SummaryThis PR adds public effect callback envelope types and verifies that both SQL and Cloudflare construct payloads matching those contracts without changing runtime delivery.
Confidence Score: 5/5The PR appears safe to merge; the public exports, backend envelope construction, and packaged declarations are consistently covered. No actionable failure remains: both backends preserve their existing callback payload behavior, the core export propagates through its existing type re-export, and CI-facing tests cover runtime envelopes and installed-package typing. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Actor emits effect] --> E[Durable effect or outbox]
E --> H[Registered effect handler]
H -->|success| S[Normalize JSON result]
H -->|exhausted or terminal failure| F[Serialize error]
S --> P1[EffectSuccessPayload]
F --> P2[EffectFailurePayload]
P1 --> C[Actor callback operation]
P2 --> C
Reviews (1): Last reviewed commit: "feat: type effect callback payloads" | Re-trigger Greptile |
Effect callbacks currently force consumers to repeat an untyped payload shape. Export
EffectFailurePayload,EffectSuccessPayload, andSerializedErrorfrom the root and core entries, and check the actual SQL/Cloudflare message construction against them. Payloads, normalization, retries, and delivery behavior stay unchanged.Before:
After:
The generics describe the application's declared effect contract; they do not infer or validate an independently registered handler. Ruby's corresponding RBS contract is tracked in cardmagic/solid-objects-ruby#64 and preserves its existing Ruby field names.
Validation:
pnpm run checkandpnpm run format:checkpassed.pnpm test: 376 passed, 21 environment-gated skips; database integration jobs run in CI.Closes #47.